﻿/*
 <?xml version="1.0"?>
<mobypicture>
  <result code="0"></result>
  <comments>
    <comment>
      <username>rutgersmit</username>
      <name></name>
      <url_avatar>http://www.mobypicture.com/images/avatar/a87c5667c2729ac5fe264dec4af142f1_60px.jpg</url_avatar>
      <url_avatar_small>http://www.mobypicture.com/images/avatar/a87c5667c2729ac5fe264dec4af142f1_24px.jpg</url_avatar_small>
      <created_on>2010-03-29 15:37:26</created_on>
      <message>Lorem ipsum dolor sit amet&#xD;w00t!</message>
    </comment>
  </comments>
</mobypicture>

 */


using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace MobySharp.Results
{
    [XmlRoot("mobypicture")]
    public class CommentsResult : BaseResult, IResult
    {
        public CommentsResult()
        {
            Comments = new List<Comment>();
            Result = new MobyResult();
        }

        [XmlArray("comments"), XmlArrayItem(ElementName = "comment")]
        public List<Comment> Comments { get; set; }

        #region Nested type: Comment

        public class Comment
        {
            [XmlElement(ElementName = "username")]
            public string Username { get; set; }

            [Obsolete("Mobypicture does not return names")]
            [XmlElement(ElementName = "name")]
            public string Name { get; set; }

            [XmlElement(ElementName = "url_avatar")]
            public string AvatarURL { get; set; }

            [XmlElement(ElementName = "url_avatar_small")]
            public string AvatarURLSmall { get; set; }

            [XmlElement(ElementName = "created_on")]
            public string CreatedOn { get; set; }

            [XmlElement(ElementName = "message")]
            public string Message { get; set; }
        }

        #endregion
    }
}